package com.example.demo.service;

import com.example.demo.mapper.UserMapper;
import com.example.demo.model.domian.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class UserService {
    @Autowired
    private UserMapper userMapper;

    public User login(String username){
        User user = userMapper.selectByName(username);
        return user;
    }

    //用户注册
    public Integer register(String username,String password){
        Integer insert = userMapper.insert(username, password);
        return insert;
    }
}
